<!DOCTYPE html>
<html lang="en">
<head>
  {% set is_top = (page and page.is_homepage) and not force_plain_page %}
  {% set base_url = config.extra.base_url or "." %}

  {%- block site_meta %}
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% if page and page.is_homepage %}<meta name="description" content="{{ config.site_description }}">{% endif %}
    {% if config.site_author %}<meta name="author" content="{{ config.site_author }}">{% endif %}
    {% if page and page.canonical_url %}<link rel="canonical" href="{{ page.canonical_url }}">{% endif %}
    {% if config.site_favicon %}<link rel="shortcut icon" href="{{ base_url }}{{ config.site_favicon }}">
    {% else %}<link rel="shortcut icon" href="{{ base_url }}img/favicon.ico">{% endif %}
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  {%- endblock %}

  {%- block htmltitle %}
    <title>{% if page and page.title and not page.is_homepage %}{{ page.title }} - {% endif %}{{ config.site_name }}</title>
  {%- endblock %}

  {%- block styles %}
    <link href="{{ base_url }}css/bootstrap-3.3.7.min.css" rel="stylesheet">
    <link href="{{ base_url }}css/font-awesome-4.7.0.css" rel="stylesheet">
    <link href="{{ base_url }}css/base.css" rel="stylesheet">
    <link rel="stylesheet" href="{{ base_url }}css/highlight.css">
    {%- for path in extra_css %}
    <link href="{{ path }}" rel="stylesheet">
    {%- endfor %}
  {%- endblock %}

  {%- block libs %}
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->

    <script src="{{ base_url }}js/jquery-3.2.1.min.js"></script>
    <script src="{{ base_url }}js/bootstrap-3.3.7.min.js"></script>
    <script src="{{ base_url }}js/highlight.pack.js"></script>
    <script src="https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js"></script>
    {% if is_top %}
      <script src="{{ base_url }}js/elasticlunr.min.js"></script>
    {% endif %}
    <base target="_top">
  {%- endblock %}

  {%- block scripts %}
    <script>
      var base_url = '{{ base_url }}';
      var is_top_frame = {% if is_top %}(window === window.parent){% else %}false{% endif %};
      {%- if page %}
        {# Include the first two levels of TOC data as a JS object, to be rendered in top frame #}
        var pageToc = [
        {%- for item in page.toc %}
          {title: {{ item.title|tojson }}, url: {{ ('#_top' if loop.first else item.url)|tojson }}, children: [
            {%- for item in item.children %}
              {title: {{ item.title|tojson }}, url: {{ item.url|tojson }} },
            {%- endfor %}
          ]},
        {%- endfor %}
        ];
      {%- else %}
        var page_toc = null;
      {%- endif %}

    </script>
    <script src="{{ base_url }}js/base.js"></script>
    {%- for path in extra_javascript %}
      <script src="{{ path }}"></script>
    {%- endfor %}
  {%- endblock %}

</head>

<body>
<script>
if (is_top_frame) { $('body').addClass('wm-top-page'); }
</script>

<div id="cookie-banner"></div>
{#
 # Code for the top frame. It should ideally be separate from the index page (which is likely
 # possible once theme_config is released with mkdocs 1.0).
 #}
{%- if is_top -%}
  {% include 'topbar.html' %}
  <div id="main-content" class="wm-page-top-frame">
    {% include 'nav-pane.html' %}
    <div class="wm-content-pane">
      <iframe class="wm-article" name="article" aria-label="Main content"></iframe>
    </div>
  </div>

{%- endif -%}

{# Code for the main template for all content pages. #}

<div class="wrapper wm-page-content">
  <div class="container-fluid">
    <a name="_top"></a>
    {%- if config.extra.article_nav_top != False %}
      {% include "article-nav.html" %}
    {%- endif %}

    {%- block content %}
      {% if page and page.meta.source %}
        <div class="source-links">
        {% for filename in page.meta.source %}
            <span class="label label-primary">{{ filename }}</span>
        {% endfor %}
        </div>
      {% endif %}

      {{ page.content }}
    {%- endblock %}

    <br>
    {%- if config.extra.article_nav_bottom != False %}
      {% include "article-nav.html" %}
      <br>
    {%- endif %}
  </div>
</div>

<footer class="wm-page-content">
{%- block footer %}
  {% include 'footer.html' %}
{%- endblock %}
</footer>

{% include 'scripts.html' %}

</body>
</html>
{%- if is_top %}
<!--
MkDocs version : {{ mkdocs_version }}
Build Date UTC : {{ build_date_utc }}
-->
{%- endif %}
